package com.FTW.service;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class WeatherService {


    @Tool(description = "根据城市获取城市的天气预报",returnDirect = false)
    public String getWeatherByCity(String city){
        Map<String, String> cityWeather = Map.of("深圳", "晴转多云，摄氏度28C，未来两天可能会下雨，请带好雨伞",
                "武汉", "多云转晴，摄氏度22C",
                "北京", "多云，摄氏度16C,沙尘暴黄色预警");

        return cityWeather.getOrDefault(city,"当前城市天气预报未更新！");
    }
}
